home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
ibm
/
loadall.arc
/
PROGD3.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-21
|
4KB
|
121 lines
RAM EQU $0040
REGS EQU $0000
Eprom EQU $F000
Vectors EQU $FFD6
PortA EQU REGS+$00
PortC EQU REGS+$03
PortB EQU REGS+$04
DDRC EQU REGS+$07
PortD EQU REGS+$08
DDRD EQU REGS+$09
CFORC EQU REGS+$0B
TCNT EQU REGS+$0E
TOC2 EQU REGS+$18
TCTL1 EQU REGS+$20
TCTL2 EQU REGS+$21
TMSK1 EQU REGS+$22
TFLG1 EQU REGS+$23
TMSK2 EQU REGS+$24
TFLG2 EQU REGS+$25
PACTL EQU REGS+$26
Baud EQU REGS+$2B
SCCR2 EQU REGS+$2D
SCSR EQU REGS+$2E
SCDR EQU REGS+$2F
OPTION EQU REGS+$39
*
*
*
FileLength EQU RAM
Address EQU RAM+1
RecordLength EQU RAM+3
*
*
*
ORG RAM
Initial LDS #$00FF !Set stack pointer to $FF.
LDAA #$30
STAA Baud !With 8MHz crystal, baud=9600.
LDAA #$0C
STAA SCCR2 !Transmitter and receiver enabled.
LDAA $80
STAA PACTL !Set bit 7 port A as an output.
LDAA #$FF
STAA DDRC !Set port C all bits as outputs.
STAA DDRD !Set port D bits 0-5 as outputs.
*
*
*
RecFileLen LDAB SCSR
LDAA PortD
EORA #$80
STAA PortD
ANDB #%00100000 !Check for byte received.
BEQ RecFileLen !Not yet, so wait.
LDAB SCDR !Get byte.
STAB FileLength
STAB SCDR
RecNewRec LDX #Address
LDY #3
RecTranInfo LDAB SCSR
ANDB #%00100000 !Check for byte received.
BEQ RecTranInfo !Not yet, so wait.
LDAB SCDR !Get byte.
STAB 0,X
INX
STAB SCDR !Send back to PC to verify.
DEY
BNE RecTranInfo
LDX Address
LDAB RecordLength
SUBB #3 !Record length contains byte
CLRA ! count for address and checksum.
XGDY
RecData LDAB SCSR
ANDB #%00100000
BEQ RecData
LDAB SCDR
STAB SCDR
ProgData LDAA #$20
STAA $003B
STAB 0,X
LDAA #$21
STAA $003B
BSR DLY10
CLR $003B
BSR DLY10
LDAA 0,X
CBA
BNE ProgData
STAA SCDR !IBM now knows programmed this byte.
INX
DEY
BNE RecData
DEC FileLength
BNE RecNewRec
!transfer done. need some kind of done exchange.
!also need start addres sent or whatever.
JMP $F000 !TEMP ONLY
*
*
*
DLY10 PSHX
LDX #$5000
DLY10Loop DEX
BNE DLY10Loop
PULX
RTS
*
*
*
INTTrap BRA INTTrap
RTI
*
*
*
END EQU *
END